#ifndef POBTRAN_H
#define POBTRAN_H

#define ORIG_TRANS_DATE_SIZE	8
#define RESP_MSG_SIZE			40
#define PIN_SIZE				16
#define KSN_SIZE				20
#define BATCH_NUM_SIZE			6
#define DATE_SIZE				6
#define TIME_SIZE				6
#define ZIPCODE_SIZE			9
#define ADDRESS_SIZE			19
#define CVV2_SIZE				4
#define SVC_CODE_SIZE			4
#define TRACK3_SIZE				150
#define CLERK_ID_SIZE			4

#define PAN_SIZE				19
#define EXP_DATE_SIZE			4
#define ISSUER_NUM_SIZE			2
#define AUTH_CODE_SIZE			6
#define RESP_CODE_SIZE			3
#define TRT_ABBREV_SIZE			2
#define ROOM_NUM_SIZE			5
#define REF_CUST_SIZE			17
#define TRACK1_SIZE				79
#define TRACK2_SIZE				38
#define CHOLDER_SIZE			30
#define RET_REF_SIZE            12

#define MSG_BUFF_SIZE			1028

#define BATCH_SIZE				200L //must be convert to long 'L'
#define MAX_RECNO				(2*BATCH_SIZE)  //be carefull not melebihi 32000
//and must be at least 2*BATCH_SIZE to get ball rolling

typedef enum OpCodes {
	OPT_VERIFY_PASSWORD = 1,
	OPT_PRIMARY_PHONE,
	OPT_SECONDARY_PHONE,
	OPT_INIT_PARAMETER,
	OPT_PARTIAL_DOWNLOAD,
	OPT_FULL_DOWNLOAD,
	OPT_SET_MASTER_KEY,
	OPT_CHANGE_BIN,
	OPT_CHANGE_PASSWORD,
	OPT_REPRINT_LAST,
	OPT_REPRINT_ANY,
	OPT_SUMMARY_REPORT,
	OPT_DETAIL_REPORT,
	OPT_PSUM_REPORT,
	OPT_PDTL_REPORT,
	OPT_CHANGE_COMM,
	OPT_POWER_OFF,
	OPT_CLEAR_REVERSAL,
	OPT_CLEAR_BATCH,
	OPT_SELECT_MENU,
	OPT_REVERSAL,
	OPT_OFFLINE,
	OPT_EXIT,
	OPT_UTILITY,
	OPT_DUMMY
};

typedef enum PobTranCodes {
	TRX_INFO_SALDO=1001,		//ATM Cashless
	TRX_PRE_TRANSFER,
	TRX_TRANSFER, 
	TRX_PAY_CC_STD, 
	TRX_PRE_PAY_PLN,
	TRX_PAY_PLN,
	TRX_PAY_PAM,
	TRX_PRE_PAY_LLPHONE_STD,
	TRX_PAY_LLPHONE_STD,
	TRX_PAY_HPHONE_STD,
	TRX_TOPUP_STD,
	TRX_BUY_VOUCHERHP_STD,
	TRX_MINI_STATEMENT,
	TRX_REGISTRASI_MB,
	TRX_PIN_CHANGE,
	TRX_TIN_CREATE,
	TRX_CREDIT_POINT,			//Bakerzin Point Reward
	TRX_CREDIT_POINT_OFFLINE,
	TRX_DEBET_POINT,
	TRX_INFO_POINT,
	PMT_TRX_PURCHASE,			//Permata Phase I
	PMT_TRX_ISI_ULANG,
	PMT_TRX_REGISTRASI,
	PMT_TRX_TIN,
	PMT_TRX_INFO_SALDO,
	PMT_TRX_MINI_STATEMENT,
	PMT_TRX_INFO_CDTCARD,
	PMT_TRX_INFO_BILLING,
	PMT_TRX_INFO_NAME,
	PMT_TRX_BAYAR_TELPON,
	PMT_TRX_BAYAR_PLN,
	PMT_TRX_BAYAR_PALYJA,
	PMT_TRX_BAYAR_PAM,
	PMT_TRX_BAYAR_CDTCARD,
	PMT_TRX_CICILAN_ACC,
	PMT_TRX_CICILAN_FIF,
	PMT_TRX_CICILAN_TAF,
	PMT_TRX_CICILAN_SCB,
	PMT_TRX_CICILAN_CITI,
	PMT_TRX_CICILAN_ADIRA,
	PMT_TRX_BAYAR_PENDIDIKAN,
	PMT_TRX_BAYAR_ASURANSI,
	PMT_TRX_BAYAR_TIKET,
	PMT_TRX_BAYAR_PAYID,
	PMT_TRX_TRANSFER,
	PMT_TRX_TRANSFER_REK_LAIN,
	PMT_TRX_TRANSFER_BANK_LAIN,
	PMT_TRX_PIN_CHANGE,
	PMT_TRX_BELANJA_POIN
};

typedef struct {
	int inCode;
	int inManual;
	long lnRevNum1;
	long lnRevNum2;
	long lnRevNum3;

	char szCode[22];
	char szFooter1[43];
	char szFooter2[43];
	char szFooter3[43];
	char szFooter4[43];
	char szFooter1B[43];
	char szFooter2B[43];
	char szFooter3B[43];
	char szFooter4B[43];
	char szMsgID[5];
	char szProcCode[7];
	unsigned char bitmap[33];
	char szMsgID_rev[5];
	char szProcCode_rev[7];
	unsigned char bitmap_rev[33];
	char szMsgID_void[5];
	char szProcCode_void[7];
	unsigned char bitmap_void[33];
	char szMsgID_voidrev[5];
	char szProcCode_voidrev[7];
	unsigned char bitmap_voidrev[33];
	char szMsgID_advice[5];
	char szProcCode_advice[7];
	unsigned char bitmap_advice[33];
} TRANSACTION_BITMAP;

typedef struct
{
	int RecordNo;  //always inc until MAX_RECNO
	int Status; //0=unprocessed, unapproved
				//1=Reversal needed
				//2=Transaction Approved and Complete
				//3=Reversal of void needed 
				//4=void approved
	int inCode;
	int inOriginalCode;
	int inMenuIndex;
	int inManual;
	int STAN;
	int VoidSTAN;
    char szDate[DATE_SIZE + 1];	//MMDDYY  ==> YYMMDD
    char szTime[TIME_SIZE + 1];	//HHMMSS
	char szTotal[20];
	long Amt;
	long Tip;
	long Total;
	long Point;
	long Balance;
	long lnVoucherAmt;
	int inAccType;			//Saving=2 or Current=3
	unsigned long lnInvNum;
	int isOnUs;

	char szRetRefNum[RET_REF_SIZE + 1];
	char szAuthCode[AUTH_CODE_SIZE + 1];          /* Auth Code           */
	char szRespCode[RESP_CODE_SIZE + 1];
    char szPAN[PAN_SIZE + 1];                     /* Account number */
    char szExpDate[EXP_DATE_SIZE + 1];            /* Expiration date */
    char szCHolder[CHOLDER_SIZE + 1];               /*  Card holder name */
	char szPIN[PIN_SIZE + 1];                           /* Pin data            */
    char szKSN[KSN_SIZE + 1];                           /* Authentication Key  */
	char szPIN2[PIN_SIZE + 1];                           /* Pin 2 data            */
	int EntryMode;  //0
	char stT2Data[TRACK2_SIZE +1];
	char szAdditionalInfo[22];
	char szInputNumber_1[22];  
	char szInputNumber_2[22];  
	char szInputNumber_3[22];  

	char szVoucherSN[19];
	char szF48[300];
	char szF54[30];
	char szF63[22];
	int  inReceiptCopy;  //1=merchant copy, 2=bank, 3=Cust Copy, 4=duplicate 

//	short TransactionCode;                 /* Field 1      */  ///part of TRT
//	short TranType;                        /* Field 2      */
//	short CardMode;                        /* Field 3      */
//    char TranAbbrev[TRT_ABBREV_SIZE + 1];  /* Field 4      */
//    short BannedCardTypes;        		   /* Field 5      */
//    short TipProc;                         /* Field 6: 0-Off, 1-On,Prompt, 2-On,No Prompt */ 

//    long lnSpecialMessageIndex;
//    long lnOTInvNum;                                    /* Orig. Open Tab's Invoice No  */
//    long lnOTAcctNum;									/* Orig. Open Tab's Acct No. */
//    long lnECRInvNum;                                   /* Store's Invoice No  */
//    int  inOperationCode;                               /* operation code   */
//    int  inTransactionCode;                             /* transaction code   */
//    char szOrigTransDate[ORIG_TRANS_DATE_SIZE + 1];     /* Original Trans Date for Debit Refund Trans */
//    char szRespMsg[RESP_MSG_SIZE + 1];                  /* Response Message  */
//    char szPIN[PIN_SIZE + 1];                           /* Pin data            */
//    char szKSN[KSN_SIZE + 1];                           /* Authentication Key  */
//    long lnMIStartTransTimer;                           // Transaction Timer
//    char szBatchNum[BATCH_NUM_SIZE + 1];                /* Batch Number        */
//    char szSettDate[DATE_SIZE + 1];                     /* in MMDDYY format    */
//    char szSettTime[TIME_SIZE + 1];                     /* in HHMMSS format    */
//    char szZipCode[ZIPCODE_SIZE + 1];                   /* pj1 - Card holder zip code */
//    char szAddress[ADDRESS_SIZE + 1];                   /* pj1 - Card holder address  */
//    char szCVV2Value[CVV2_SIZE + 1];                    /* CVV2 value */
//   char chCVV2PresenceIndicator;                       /* CVV2 presence indicator */
//    long lnOldTaxAmount;                                /* Orig. tax amount for percent re-calculation */
//	int  inChipStatus;				/* 0 NOT_USING_CHIP, 1 EMV_CARD, 2 EMV_EASY_ENTRY_CARD*/
//
//  char szServiceCode[SVC_CODE_SIZE + 1];        /* Service code from track */
//    char stT3Data[TRACK3_SIZE +1];                /* Track 3 bare format */
//    int  inSaveTCTLanguage;                       /* Save language for hand held language swap*/

//    unsigned char *pchFlexiData;				  		/* Pointer to Flexible transaction data */

//    unsigned fReferral:1;                               /* Denotes that this trans is a referral */
//    unsigned fSwitchedCard:1;
//	unsigned fPreprinted:1;
//	unsigned fPredialed:1;
//	unsigned fReqMem:1;
//	unsigned fBatchOpen:1;
//	unsigned fOTBatchOpen:1;
//    unsigned fAdjust:1;                                 /* Adjust */
//    unsigned fTipAdjust:1;                              /* Tip Adjust */
//    unsigned fTaxAdjust:1;                              /* Tax Adjust */
//    unsigned fOtherAdjust:1;                            /* Other Adjust (i.e. User or Approval Code) */
//    unsigned fAutoSettle:1;                             /* Settle started from Idle Loop on timer  */
//    unsigned fFloorLimit:1;                             /* Trans is offline because of floor limit */
//    unsigned fSendDuplicate:1;                          /* Sending duplicate transaction data flag */
//    unsigned fVoidedBatchRec:1;                         /* VoidBatchRec has been run on current batch record */
//    unsigned fAdjustedBatchRec:1;                       /* AdjustBatchRec has been run on current batch record */

//    unsigned fLanguageOnSwipe:1;                        /* Language indicator is in track II data */
//    unsigned fInteracDebit:1;                           /* Card swipe determines interac debit card */
//    unsigned fRetry:1;                                  /* Transaction is being retried */
//    unsigned fCardPresent:1;                            /* Card Present 0=no 1=yes */
//    unsigned fHHSwipeOnly:1;                            /* Swipe Only 0=no 1=yes */
//    unsigned fHHNoTax:1;                                /* HH No Tax 0=no 1=yes */
//    unsigned fSettleSucceeded:1;                        /* Settle succeed 0=no 1=yes */
//    unsigned fCounterPayTip:1;                          /* Counter Pay Tipping 0=no 1=yes */


//    long    	lnRecNum;                           /* Compulsary for DBFM      */  ///part Of BATCH KEY
//    long    	lnInvNum;                           /* Invoice number as long   */
//    char    	chShift;                            /* Shift Number             */
//    long    	lnLast4;                            /* Last 4 digits as long    */
//    char    	szClerkId[CLERK_ID_SIZE + 1];       /* Clk/Svr ID               */
//    long    	lnTotalOfTransactionAmount;         /* Transaction amount       */
//    long    	lnOrgSTAN;                          /* The original Stan the man... */
//    int     	inCurrencyIndex;                    /* Currency index for batch record */
//    int     	inBatchHostIndex;                   /* Index to this->Batch */
//    int     	inHDTIndex;                   		/* Index to this->host */
//    unsigned 	fOffline       : 1;                 /* Is this Offline?  */
//    unsigned 	fVoided        : 1;                 /* Voided flag */
//    unsigned 	fUploaded      : 1;                 /* Uploaded flag */

	//BATCH_REC	srBRec;  //see below

} TRANSACTION_OBJECT;


typedef struct TagBATCH_REC
{
    int  inCode;                                /* Trans Code */
    int  inOrgCode;                             /* Original Trans Code  */
    int  inType;                                /* Transaction type */
    long lnBaseTransactionAmount;               /* The base transaction amount, such as a SALE. */
    long lnOrigTotalTransactionAmount;          /* Original Total Amount */
    long lnOldTotalTransactionAmount;           /* Original Total Amount */
    long lnTipAmount;
    long lnOldTipAmount;
    long lnTaxAmount;
    long lnDualAmount;
    long lnCashBackAmount;
    long lnSChgAmount;
    long lnSTAN;								  /* Stan's the man...        */
    char szPAN[PAN_SIZE + 1];                     /* Account number */
    char szExpDate[EXP_DATE_SIZE + 1];            /* Expiration date */
	char szIssueNumber[ISSUER_NUM_SIZE + 1];
    char szAuthCode[AUTH_CODE_SIZE + 1];          /* Auth Code           */
    char szRespCode[RESP_CODE_SIZE + 1];          /* Response Code       */
    int  inTranCardType      ;                    /* Credit, Debit, Loyal  */
    char szDate[DATE_SIZE + 1];
    char szTime[TIME_SIZE + 1];
    long lnMessage;                               /* Message associated w/ transaction. */
    int  inPrintOption;                           /* Print Option Flag (also in TCT) */
                                                  /* 0=None,1=Prompt,2=Cust,3=Merch,4=Both */
    int  inCDTIndex;                  			  /* Currently loaded CDT iff card host */

    int  inLCTIndex;                  			  /* Language index for receipt */
    int  inMerchantIndex;						  /* Merchant index */

    int inNumberOfAdjusts;           			  /* number of adjustments made to transactions */
    int inNumberOfTipAdjusts;        			  /* number of Tip adjust made to transactions */
    int inTransactionResult;					  /* Authorized, Declined or Cancelled */

    /* ECI Information */
    char chECI;                       			  /* Electronic Commerce Indicator */
    char szTranAbbrev[TRT_ABBREV_SIZE + 1];  	  /* Tran abbrev for reports */

	/* Variables for the use of Payments			*/
    int inInstallmentType;
    int inInstallments;
    int inPlan;
    long lnDepositAmount;
    long lnAmountPerInstallment;

	char szStartDate[EXP_DATE_SIZE + 1];
	int  inChipStatus;				/* 0 NOT_USING_CHIP, 1 EMV_CARD, 2 EMV_EASY_ENTRY_CARD*/
											        /*  Linked List variables for new batch records
													    per Adjust/Void transactions */
    long	lnForwardLinkInvNum;					/*  Inv # batch record forward link */
    long	lnBackLinkInvNum;						/*  Inv # batch record backward link */
    long	lnOrgInvNum;							/*  Original Transaction Invoice # */

    unsigned fManual            : 1;                /*  Manual/Swipe      */
    unsigned fTaxEntered        : 1;                /*  Tax has been prompted for or Calculated */
    unsigned fTipEntered        : 1;                /*  Tip has been prompted for or Calculated */
    unsigned fDualEntered       : 1;                /*  Dual Currency has been prompted for or Calculated */
    unsigned fCloseTabSameCard  : 1;                /*  Close Tab tran with same card */
    unsigned fCloseTabNewCard   : 1;                /*  Close Tab tran with new card */
    unsigned fComputeOverage    : 1;                /*  Overage Applied flag*/
    unsigned fDoNotUploadRec	: 1;				/*  Do Not Upload Batch Record flag */
    unsigned fLastTranUploaded	: 1;				/*  Last Transaction Uploaded flag */
	unsigned fWebTran           : 1;                /*  Web Tran 0=no, 1=yes */
	                                                //  Optional Field bits
	unsigned fRoomNum           : 1;                //  Room Number stored
	unsigned fCustNum           : 1;                //  Customer Number stored
	unsigned fT1Data            : 1;                //  Track 1 Data stored 
	unsigned fT2Data            : 1;                //  Track 2 Data stored 
	unsigned fCHolder           : 1;                //  Card holder name stored

	//  Below Fields not saved as part of the Batch Data Structure
    unsigned char *pchHostData;					    /*  Pointer to Host specific batch data */
    
    // Optional fields not always stored in the batch record
    char szRoomNum[ROOM_NUM_SIZE + 1];
    
    char szCustNum[REF_CUST_SIZE + 1];              /*  CustNo Purch Card Support */
    
    char stT1Data[TRACK1_SIZE +1];                  /*  Track 1 bare format */
    char stT2Data[TRACK2_SIZE +1];                  /*  Track 2 bare format */
    char szCHolder[CHOLDER_SIZE + 1];               /*  Card holder name */
    
} BATCH_REC;


void PrinterInit(void);
void VIP_Lounge(TRANSACTION_OBJECT *pobTran);
void Void(TRANSACTION_OBJECT *pobTran);
void AnzPayment(TRANSACTION_OBJECT *pobTran);
void ReprintLastTransaction(TRANSACTION_OBJECT *pobTran);
void ReprintAnyTransaction(TRANSACTION_OBJECT *pobTran);
void ReportBatch(TRANSACTION_OBJECT *pobTran);
void SummaryReport(TRANSACTION_OBJECT *pobTran);
void DetailReport(TRANSACTION_OBJECT *pobTran);
void PastReport(TRANSACTION_OBJECT *pobTran);
int BeginSetup();
int DoSetPriAuthPhone();
int DoSetSecAuthPhone();
int DoChangeBIN();
int DoChangePassword();

int inShowTitle(TRANSACTION_OBJECT *pobTran);
int inShowPobTran(TRANSACTION_OBJECT *pobTran);
int inGetCard(TRANSACTION_OBJECT *pobTran);
int inGetCardInside(TRANSACTION_OBJECT *pobTran);
int inGetCardManual(TRANSACTION_OBJECT *pobTran);
int inCheckCard(TRANSACTION_OBJECT *pobTran);
int inSelectAccount(TRANSACTION_OBJECT *pobTran);
int inGetAmount(TRANSACTION_OBJECT *pobTran, char *Msg);
int inGetAmountForBillPayment(TRANSACTION_OBJECT *pobTran, char *Msg);
int inGetTip(TRANSACTION_OBJECT *pobTran, char *Msg);
int inGetPoint(TRANSACTION_OBJECT *pobTran, char *Msg);
int inGetGeneralInputNumber_1(TRANSACTION_OBJECT *pobTran, char *Msg, int MinDigit, int MaxDigit);
int inGetGeneralInputNumber_2(TRANSACTION_OBJECT *pobTran, char *Msg, int MinDigit, int MaxDigit);
int inGetGeneralInputNumber_3(TRANSACTION_OBJECT *pobTran, char *Msg, int MinDigit, int MaxDigit);
int inGetVoucherAmt(TRANSACTION_OBJECT *pobTran, char *Msg);
//int inGetRcptAcc(TRANSACTION_OBJECT *pobTran, char *Ket);
int inGetEncryptedPin(TRANSACTION_OBJECT *pobTran, char *Msg);
void vdUpdateLnTotal(TRANSACTION_OBJECT *pobTran);

int DisplayTotal(TRANSACTION_OBJECT *pobTran);
//int inDisplayRcptName(TRANSACTION_OBJECT *pobTran, char *Ket);
int GetPin(TRANSACTION_OBJECT *pobTran);
int SendAndReceiveMessage(TRANSACTION_OBJECT *pobTran, unsigned char *SentBuff, unsigned char *RecvBuff, int Reversal);
//int GetConfirm(TRANSACTION_OBJECT *pobTran, char *Msg);
int	inDisplayResponse(TRANSACTION_OBJECT *pobTran, unsigned long lnShowTime);
int	PrintResponse(TRANSACTION_OBJECT *pobTran);
int PrintRcpt(TRANSACTION_OBJECT *pobTran);
int	RePrintResponse(TRANSACTION_OBJECT *pobTran);
int PrintSummaryReport(char *TheDate);
int PrintDetailReport(char *TheDate);

int inPrintHeader(TRANSACTION_OBJECT *pobTran);
int inPrintCardDetail(TRANSACTION_OBJECT *pobTran);
int inPrintTransactionDetail(TRANSACTION_OBJECT *pobTran);
int inPrintSignature(TRANSACTION_OBJECT *pobTran);
int inPrintFooter(TRANSACTION_OBJECT *pobTran);
int inPrintShiftPaper(TRANSACTION_OBJECT *pobTran);
void LOG_PRINT_RCPT_HEX(unsigned char* buf, int size);
void LOG_PRINT_RCPT(char *buff);

int CreateBatchRecord(void);
int ChooseBatchRecord(unsigned long ulInvNum, int status, TRANSACTION_OBJECT *pobTran);
int SaveBatchRecord(TRANSACTION_OBJECT *pobTran);
int SaveNewBatchRecord(TRANSACTION_OBJECT *pobTran);
int SaveBatchRecordForReversal(TRANSACTION_OBJECT *pobTran);
int SaveBatchRecordAfterReversal(TRANSACTION_OBJECT *pobTran);
int SaveBatchRecordAfterTrx(TRANSACTION_OBJECT *pobTran);
int FindAndSendReversal(void);
int GetLastTransactionRecord(int status, TRANSACTION_OBJECT *pobTran);
int GetReversalTransactionRecord(TRANSACTION_OBJECT *pobTran);
int SendAndReceiveReversal(TRANSACTION_OBJECT *pobTran, unsigned char *SentBuff, unsigned char *RecvBuff);

int inInitConfig(void);


int inDoInfomasiSaldo(TRANSACTION_OBJECT *pobTran);
int inDoTransferDana(TRANSACTION_OBJECT *pobTran);
int inDoBayarKartuKreditStd(TRANSACTION_OBJECT *pobTran);
int inDoBayarPLN(TRANSACTION_OBJECT *pobTran);
int inDoBayarTelpon(TRANSACTION_OBJECT *pobTran);
int inDoBayarHpStd(TRANSACTION_OBJECT *pobTran);
int inDoTopUpStd(TRANSACTION_OBJECT *pobTran);
int inDoBuyVoucherStd(TRANSACTION_OBJECT *pobTran);
int inDoMiniStatement(TRANSACTION_OBJECT *pobTran);
int inDoRegistrasiMobileBanking(TRANSACTION_OBJECT *pobTran);
int inDoChangePIN(TRANSACTION_OBJECT *pobTran);
int inDoCreateTIN(TRANSACTION_OBJECT *pobTran);
int inDoReprintLastTrx(TRANSACTION_OBJECT *pobTran);
int inDoReprintAnyTrx(TRANSACTION_OBJECT *pobTran);
int inDoSummaryReport(TRANSACTION_OBJECT *pobTran);
int inDoDetailReport(TRANSACTION_OBJECT *pobTran);
int inDoSummaryPastReport(TRANSACTION_OBJECT *pobTran);
int inDoDetailPastReport(TRANSACTION_OBJECT *pobTran);
int inDoChangeComm(TRANSACTION_OBJECT *pobTran);
int inDoPowerOff(TRANSACTION_OBJECT *pobTran);
int inDoSendReversal(TRANSACTION_OBJECT *pobTran);
int inDoVerifySetup(TRANSACTION_OBJECT *pobTran);
int inDoSetupPrimaryPhone(TRANSACTION_OBJECT *pobTran);
int inDoSetupSecondaryPhone(TRANSACTION_OBJECT *pobTran);
int inDoSetupInitParameter(TRANSACTION_OBJECT *pobTran);
int inDoSetupPartialDownload(TRANSACTION_OBJECT *pobTran);
int inDoSetupFullDownload(TRANSACTION_OBJECT *pobTran);
int inDoSetupSetMasterKey(TRANSACTION_OBJECT *pobTran);
int inDoSetupChangeBIN(TRANSACTION_OBJECT *pobTran);
int inDoSetupChangePassword(TRANSACTION_OBJECT *pobTran);
int inDoClearReversal(TRANSACTION_OBJECT *pobTran);
int inDoClearBatch(TRANSACTION_OBJECT *pobTran);
int inDoSelectMenu(TRANSACTION_OBJECT *pobTran);
int inDoExit(TRANSACTION_OBJECT *pobTran);
int inDoUtility(TRANSACTION_OBJECT *pobTran);
int inDoDummy(TRANSACTION_OBJECT *pobTran);
	
int inDoInfoPoint(TRANSACTION_OBJECT *pobTran);
int inDoCreditPoint(TRANSACTION_OBJECT *pobTran);
int inDoCreditPointOffline(TRANSACTION_OBJECT *pobTran);
int inDoDebetPoint(TRANSACTION_OBJECT *pobTran);
int inDoSendOffline(TRANSACTION_OBJECT *pobTran);

int inDoPmtTrxPurchase(TRANSACTION_OBJECT *pobTran);
int	inDoPmtTrxIsiUlang(TRANSACTION_OBJECT *pobTran);
int	inDoPmtTrxRegistrasi(TRANSACTION_OBJECT *pobTran);
int	inDoPmtTrxTin(TRANSACTION_OBJECT *pobTran);

int inDoPmtTrxInfoSaldo(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxMiniStatement(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxInfoCdtCard(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBillPayment(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarTelpon(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarPln(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarPalyja(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarPam(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarCdtCard(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxCicilanAcc(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxCicilanFif(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxCicilanTaf(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxCicilanScb(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxCicilanCiti(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxCicilanAdira(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarPendidikan(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarAsuransi(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarTiket(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBayarPayid(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxGeneralTransfer(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxTransfer(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxTransferRekLian(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxTransferBankLain(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxPinChange(TRANSACTION_OBJECT *pobTran);
int inDoPmtTrxBelanjaPoin(TRANSACTION_OBJECT *pobTran);
void vdDisplayMerchantName(void);
void vdDisplayFee(TRANSACTION_OBJECT *pobTran);
void vdDisplayFee2(TRANSACTION_OBJECT *pobTran);
void vdGetTrxFee(char *buffer, TRANSACTION_OBJECT *pobTran);

int inSetFooterText(char *szDest, char *szID);

#define TRX_MANUAL		"TRX.MANUAL"
#define HOST_CARD_ONUS  "HOST.CARD.ONUS"
#define TXR_OFFUS		"TRX.OFFUS"
#define FEE				"FEE"
#define POWERSAVE		"POWERSAVE"

#define PRT_HEADER1		"PRT.HEADER1"
#define PRT_HEADER2		"PRT.HEADER2"
#define PRT_HEADER3		"PRT.HEADER3"
#define PRT_HEADER4		"PRT.HEADER4"

#define PRT_PURCHASE_FOOTER1	"PRT.SALE.F1"
#define PRT_PURCHASE_FOOTER2	"PRT.SALE.F2"
#define PRT_PURCHASE_FOOTER3	"PRT.SALE.F3"
#define PRT_PURCHASE_FOOTER4	"PRT.SALE.F4"
#define PRT_PURCHASE_FOOTER1B	"PRT.SALE.F1B"
#define PRT_PURCHASE_FOOTER2B	"PRT.SALE.F2B"
#define PRT_PURCHASE_FOOTER3B	"PRT.SALE.F3B"
#define PRT_PURCHASE_FOOTER4B	"PRT.SALE.F4B"

#define PRT_IU_FOOTER1			"PRT.IU.F1"
#define PRT_IU_FOOTER2			"PRT.IU.F2"
#define PRT_IU_FOOTER3			"PRT.IU.F3"
#define PRT_IU_FOOTER4			"PRT.IU.F4"
#define PRT_IU_FOOTER1B			"PRT.IU.F1B"
#define PRT_IU_FOOTER2B			"PRT.IU.F2B"
#define PRT_IU_FOOTER3B			"PRT.IU.F3B"
#define PRT_IU_FOOTER4B			"PRT.IU.F4B"

#define PRT_REG_FOOTER1				"PRT.REG.F1"
#define PRT_REG_FOOTER2				"PRT.REG.F2"
#define PRT_REG_FOOTER3				"PRT.REG.F3"
#define PRT_REG_FOOTER4				"PRT.REG.F4"
#define PRT_REG_FOOTER1B			"PRT.REG.F1B"
#define PRT_REG_FOOTER2B			"PRT.REG.F2B"
#define PRT_REG_FOOTER3B			"PRT.REG.F3B"
#define PRT_REG_FOOTER4B			"PRT.REG.F4B"

#define PRT_MINI_STATEMENT_F1		"PRT.MS.F1"
#define PRT_MINI_STATEMENT_F2		"PRT.MS.F2"
#define PRT_MINI_STATEMENT_F3		"PRT.MS.F3"
#define PRT_MINI_STATEMENT_F4		"PRT.MS.F4"
#define PRT_MINI_STATEMENT_F1B		"PRT.MS.F1B"
#define PRT_MINI_STATEMENT_F2B		"PRT.MS.F2B"
#define PRT_MINI_STATEMENT_F3B		"PRT.MS.F3B"
#define PRT_MINI_STATEMENT_F4B		"PRT.MS.F4B"

#define PRT_BAYAR_TELPON_F1			"PRT.BTLP.F1"
#define PRT_BAYAR_TELPON_F2			"PRT.BTLP.F2"
#define PRT_BAYAR_TELPON_F3			"PRT.BTLP.F3"
#define PRT_BAYAR_TELPON_F4			"PRT.BTLP.F4"
#define PRT_BAYAR_TELPON_F1B		"PRT.BTLP.F1B"
#define PRT_BAYAR_TELPON_F2B		"PRT.BTLP.F2B"
#define PRT_BAYAR_TELPON_F3B		"PRT.BTLP.F3B"
#define PRT_BAYAR_TELPON_F4B		"PRT.BTLP.F4B"

#define PRT_BAYAR_PLN_F1			"PRT.BPLN.F1"
#define PRT_BAYAR_PLN_F2			"PRT.BPLN.F2"
#define PRT_BAYAR_PLN_F3			"PRT.BPLN.F3"
#define PRT_BAYAR_PLN_F4			"PRT.BPLN.F4"
#define PRT_BAYAR_PLN_F1B			"PRT.BPLN.F1B"
#define PRT_BAYAR_PLN_F2B			"PRT.BPLN.F2B"
#define PRT_BAYAR_PLN_F3B			"PRT.BPLN.F3B"
#define PRT_BAYAR_PLN_F4B			"PRT.BPLN.F4B"

#define PRT_BAYAR_PALYJA_F1			"PRT.BPLJ.F1"
#define PRT_BAYAR_PALYJA_F2			"PRT.BPLJ.F2"
#define PRT_BAYAR_PALYJA_F3			"PRT.BPLJ.F3"
#define PRT_BAYAR_PALYJA_F4			"PRT.BPLJ.F4"
#define PRT_BAYAR_PALYJA_F1B		"PRT.BPLJ.F1B"
#define PRT_BAYAR_PALYJA_F2B		"PRT.BPLJ.F2B"
#define PRT_BAYAR_PALYJA_F3B		"PRT.BPLJ.F3B"
#define PRT_BAYAR_PALYJA_F4B		"PRT.BPLJ.F4B"

#define PRT_BAYAR_PAM_F1			"PRT.BPAM.F1"
#define PRT_BAYAR_PAM_F2			"PRT.BPAM.F2"
#define PRT_BAYAR_PAM_F3			"PRT.BPAM.F3"
#define PRT_BAYAR_PAM_F4			"PRT.BPAM.F4"
#define PRT_BAYAR_PAM_F1B			"PRT.BPAM.F1B"
#define PRT_BAYAR_PAM_F2B			"PRT.BPAM.F2B"
#define PRT_BAYAR_PAM_F3B			"PRT.BPAM.F3B"
#define PRT_BAYAR_PAM_F4B			"PRT.BPAM.F4B"

#define PRT_BAYAR_CDTCD_F1			"PRT.BCCD.F1"
#define PRT_BAYAR_CDTCD_F2			"PRT.BCCD.F2"
#define PRT_BAYAR_CDTCD_F3			"PRT.BCCD.F3"
#define PRT_BAYAR_CDTCD_F4			"PRT.BCCD.F4"
#define PRT_BAYAR_CDTCD_F1B			"PRT.BCCD.F1B"
#define PRT_BAYAR_CDTCD_F2B			"PRT.BCCD.F2B"
#define PRT_BAYAR_CDTCD_F3B			"PRT.BCCD.F3B"
#define PRT_BAYAR_CDTCD_F4B			"PRT.BCCD.F4B"

#define PRT_BAYAR_ACC_F1			"PRT.BACC.F1"
#define PRT_BAYAR_ACC_F2			"PRT.BACC.F2"
#define PRT_BAYAR_ACC_F3			"PRT.BACC.F3"
#define PRT_BAYAR_ACC_F4			"PRT.BACC.F4"
#define PRT_BAYAR_ACC_F1B			"PRT.BACC.F1B"
#define PRT_BAYAR_ACC_F2B			"PRT.BACC.F2B"
#define PRT_BAYAR_ACC_F3B			"PRT.BACC.F3B"
#define PRT_BAYAR_ACC_F4B			"PRT.BACC.F4B"

#define PRT_BAYAR_FIF_F1			"PRT.BFIF.F1"
#define PRT_BAYAR_FIF_F2			"PRT.BFIF.F2"
#define PRT_BAYAR_FIF_F3			"PRT.BFIF.F3"
#define PRT_BAYAR_FIF_F4			"PRT.BFIF.F4"
#define PRT_BAYAR_FIF_F1B			"PRT.BFIF.F1B"
#define PRT_BAYAR_FIF_F2B			"PRT.BFIF.F2B"
#define PRT_BAYAR_FIF_F3B			"PRT.BFIF.F3B"
#define PRT_BAYAR_FIF_F4B			"PRT.BFIF.F4B"

#define PRT_BAYAR_SCB_F1			"PRT.BSCB.F1"
#define PRT_BAYAR_SCB_F2			"PRT.BSCB.F2"
#define PRT_BAYAR_SCB_F3			"PRT.BSCB.F3"
#define PRT_BAYAR_SCB_F4			"PRT.BSCB.F4"
#define PRT_BAYAR_SCB_F1B			"PRT.BSCB.F1B"
#define PRT_BAYAR_SCB_F2B			"PRT.BSCB.F2B"
#define PRT_BAYAR_SCB_F3B			"PRT.BSCB.F3B"
#define PRT_BAYAR_SCB_F4B			"PRT.BSCB.F4B"

#define PRT_BAYAR_CITI_F1			"PRT.BCITI.F1"
#define PRT_BAYAR_CITI_F2			"PRT.BCITI.F2"
#define PRT_BAYAR_CITI_F3			"PRT.BCITI.F3"
#define PRT_BAYAR_CITI_F4			"PRT.BCITI.F4"
#define PRT_BAYAR_CITI_F1B			"PRT.BCITI.F1B"
#define PRT_BAYAR_CITI_F2B			"PRT.BCITI.F2B"
#define PRT_BAYAR_CITI_F3B			"PRT.BCITI.F3B"
#define PRT_BAYAR_CITI_F4B			"PRT.BCITI.F4B"

#define PRT_BAYAR_ADIRA_F1			"PRT.BADIRA.F1"
#define PRT_BAYAR_ADIRA_F2			"PRT.BADIRA.F2"
#define PRT_BAYAR_ADIRA_F3			"PRT.BADIRA.F3"
#define PRT_BAYAR_ADIRA_F4			"PRT.BADIRA.F4"
#define PRT_BAYAR_ADIRA_F1B			"PRT.BADIRA.F1B"
#define PRT_BAYAR_ADIRA_F2B			"PRT.BADIRA.F2B"
#define PRT_BAYAR_ADIRA_F3B			"PRT.BADIRA.F3B"
#define PRT_BAYAR_ADIRA_F4B			"PRT.BADIRA.F4B"

#define PRT_BAYAR_PDDKN_F1			"PRT.BPDD.F1"
#define PRT_BAYAR_PDDKN_F2			"PRT.BPDD.F2"
#define PRT_BAYAR_PDDKN_F3			"PRT.BPDD.F3"
#define PRT_BAYAR_PDDKN_F4			"PRT.BPDD.F4"
#define PRT_BAYAR_PDDKN_F1B			"PRT.BPDD.F1B"
#define PRT_BAYAR_PDDKN_F2B			"PRT.BPDD.F2B"
#define PRT_BAYAR_PDDKN_F3B			"PRT.BPDD.F3B"
#define PRT_BAYAR_PDDKN_F4B			"PRT.BPDD.F4B"

#define PRT_BAYAR_ASURANSI_F1		"PRT.BASR.F1"
#define PRT_BAYAR_ASURANSI_F2		"PRT.BASR.F2"
#define PRT_BAYAR_ASURANSI_F3		"PRT.BASR.F3"
#define PRT_BAYAR_ASURANSI_F4		"PRT.BASR.F4"
#define PRT_BAYAR_ASURANSI_F1B		"PRT.BASR.F1B"
#define PRT_BAYAR_ASURANSI_F2B		"PRT.BASR.F2B"
#define PRT_BAYAR_ASURANSI_F3B		"PRT.BASR.F3B"
#define PRT_BAYAR_ASURANSI_F4B		"PRT.BASR.F4B"

#define PRT_BAYAR_TIKET_F1			"PRT.BTKT.F1"
#define PRT_BAYAR_TIKET_F2			"PRT.BTKT.F2"
#define PRT_BAYAR_TIKET_F3			"PRT.BTKT.F3"
#define PRT_BAYAR_TIKET_F4			"PRT.BTKT.F4"
#define PRT_BAYAR_TIKET_F1B			"PRT.BTKT.F1B"
#define PRT_BAYAR_TIKET_F2B			"PRT.BTKT.F2B"
#define PRT_BAYAR_TIKET_F3B			"PRT.BTKT.F3B"
#define PRT_BAYAR_TIKET_F4B			"PRT.BTKT.F4B"

#define PRT_BAYAR_PAYID_F1			"PRT.BPID.F1"
#define PRT_BAYAR_PAYID_F2			"PRT.BPID.F2"
#define PRT_BAYAR_PAYID_F3			"PRT.BPID.F3"
#define PRT_BAYAR_PAYID_F4			"PRT.BPID.F4"
#define PRT_BAYAR_PAYID_F1B			"PRT.BPID.F1B"
#define PRT_BAYAR_PAYID_F2B			"PRT.BPID.F2B"
#define PRT_BAYAR_PAYID_F3B			"PRT.BPID.F3B"
#define PRT_BAYAR_PAYID_F4B			"PRT.BPID.F4B"

#define PRT_TR_F1					"PRT.TROWN.F1"
#define PRT_TR_F2					"PRT.TROWN.F2"
#define PRT_TR_F3					"PRT.TROWN.F3"
#define PRT_TR_F4					"PRT.TROWN.F4"
#define PRT_TR_F1B					"PRT.TROWN.F1B"
#define PRT_TR_F2B					"PRT.TROWN.F2B"
#define PRT_TR_F3B					"PRT.TROWN.F3B"
#define PRT_TR_F4B					"PRT.TROWN.F4B"

#define PRT_TF_OTHER_F1				"PRT.TROTH.F1"
#define PRT_TF_OTHER_F2				"PRT.TROTH.F2"
#define PRT_TF_OTHER_F3				"PRT.TROTH.F3"
#define PRT_TF_OTHER_F4				"PRT.TROTH.F4"
#define PRT_TF_OTHER_F1B			"PRT.TROTH.F1B"
#define PRT_TF_OTHER_F2B			"PRT.TROTH.F2B"
#define PRT_TF_OTHER_F3B			"PRT.TROTH.F3B"
#define PRT_TF_OTHER_F4B			"PRT.TROTH.F4B"

#define PRT_TF_ONLINE_F1			"PRT.TRONL.F1"
#define PRT_TF_ONLINE_F2			"PRT.TRONL.F2"
#define PRT_TF_ONLINE_F3			"PRT.TRONL.F3"
#define PRT_TF_ONLINE_F4			"PRT.TRONL.F4"
#define PRT_TF_ONLINE_F1B			"PRT.TRONL.F1B"
#define PRT_TF_ONLINE_F2B			"PRT.TRONL.F2B"
#define PRT_TF_ONLINE_F3B			"PRT.TRONL.F3B"
#define PRT_TF_ONLINE_F4B			"PRT.TRONL.F4B"

#define F48_ADD_SIZE  30  //add to cover changing reply message suggested by Mr. Toro about inst name

#endif